package com.asiainfo.crm.core.web;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import com.asiainfo.crm.core.common.CommFunc;

public class VerifyUrlRightFilter implements Filter {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger
			.getLogger(VerifyUrlRightFilter.class);

	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
//		HttpServletRequest hRequest = (HttpServletRequest) request;
//		String url = hRequest.getRequestURI();
//		if (!CommFunc.hasRight(hRequest, url)) {
//			request.getRequestDispatcher("/jsp/error.jsp").forward(request,
//					response);
//		}

//		hRequest.getSession().setAttribute(SessionInfo.CURR_RESOURCE_URL, url);
		chain.doFilter(request, response);

	}

	public void destroy() {

	}

	public void init(FilterConfig arg0) throws ServletException {

	}

}
